<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\Park;
use app\models\Person;

/* @var $this yii\web\View */
/* @var $model app\models\Land */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="land-form">

    <?php $form = ActiveForm::begin(); ?>

    <?php
    if($model->park_id!=0) {
        echo $form->field($model, 'park_id')->dropdownlist(
            Park::find()->select(['name'])->indexBy('id')->column(),
            ['prompt' => '选择所属园区', 'disabled' => 'disabled']);
    }else{
        echo  $form->field($model, 'park_id')->dropdownlist(
            Park::find()->select(['name'])->indexBy('id')->column(),
            ['prompt' => '选择所属园区']);
    }?>

    <!--?= $form->field($model, 'code')->textInput(['maxlength' => true]) ?-->

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'introduction')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'scale')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'map_image')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'tel')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'comment')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'pricipal_id')->dropdownlist(
        Person::find()->select(['name'])->indexBy('id')->column(),
        ['prompt' => '选择负责人']) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '新建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
